package com.pangsir.bookstore.dao.impl;

import com.pangsir.bookstore.dao.BookDao;
import com.pangsir.bookstore.pojo.Book;
import com.pangsir.myssm.basedao.BaseDAO;


import java.util.List;

public class BookDaoImpl extends BaseDAO<Book> implements BookDao {
    @Override
    public List<Book> getAllBookList() {
        String sql = "select * from t_book where bookstatus = 0";
        return super.executeQuery(sql);
    }

    @Override
    public Book getBookById(Integer id) {
        String sql = "select * from t_book where bookstatus = 0 and id = ?";
        return super.load(sql,id);
    }
}
